﻿@model PageList<Student>
@{
    int status = ViewBag.status;
    bool hasCommand = status == 0;
}
<table class="table table-striped table-bordered table-hover table-fix table-manage">
    <thead>
        <tr>
            @if (hasCommand)
            {
                <th class="w35px">
                    <label><input class="checkbox-check" type="checkbox"><span></span></label>
                </th>
            }
            <th class="text-center w80px" data-order="@nameof(Student.Name)">学员姓名</th>
            <th class="text-center w180px" data-order="@nameof(Student.IDCardNo)">身份证号</th>
            <th class="text-center w120px" data-order="@nameof(Student.MobilePhone)">手机号码</th>
            <th class="text-center " data-order="@nameof(Student.SchoolName)">培训机构</th>
            <th class="text-center w200px" data-order="@nameof(Student.WorkCategoryName)">从业类型</th>
            <th class="text-center w100px" data-order="@nameof(Student.CreateDateTime)">录入时间</th>
            <th class="text-center w120px" data-order="@nameof(Student.TotalPeriod)">总学时</th>
            <th class="text-center w70px" data-order="@nameof(Student.Status)">状态</th>
            @if (hasCommand)
            {
                <th class="text-center w50px">操作</th>
            }
        </tr>
    </thead>
    <tbody>
        @foreach (var record in Model)
            {
            <tr>
                @if (hasCommand)
                {
                    <td>
                        <label><input class="checkbox-check" type="checkbox" value="@record.Id"><span></span></label>
                    </td>
                }
                <td class="text-center">
                    <a class="uimodal" data-size="lg" data-backdrop="true" data-url="@Url.Action("Details", "Student", new {id = record.Id})">
                        @record.Name
                    </a>
                </td>
                <td class="text-center ">@record.IDCardNo</td>
                <td class="text-center ">@record.MobilePhone</td>
                <td class="text-center nowrap">@record.SchoolName</td>
                <td class="text-center ">@record.WorkCategoryName</td>
                <td class="text-center">@DateTimeHelper.FormatDate(record.CreateDateTime)</td>
                <td class="text-center ">@record.TotalPeriodName</td>
                <td class="text-center">@Html.StudentStatusLabel(record)</td>
                @if (hasCommand)
                {
                    <td class="text-center">
                        <a class="color-primary uimodal" data-size="lg" data-url="@Url.Action("Edit","Student", new {id = record.Id})">
                            编辑
                        </a>
                    </td>
                }
            </tr>
        }
    </tbody>
</table>
@Html.RenderPages(Model)